<template>
  <div>
    <input type="text" @keyup.enter="key" />
    <input type="text" @keyup.esc="key1" />
  </div>
</template>

<script>

export default {

  methods: {
    key () {
      console.log('只能按enter')//只能按enter

    },
    key1 () {
      console.log('只能按esc')//只能按esc
    }
  }
}
</script>

<style>
</style>